package 线程.作业.线程的三种方式;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class 线程03 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
//        new Thread(new FutureTask<>(new xiancheng03())).start();

        xiancheng03 xc3 = new xiancheng03();
        FutureTask ft = new FutureTask<>(xc3);
        Thread thread = new Thread(ft);
        thread.start();
        String o = (String) ft.get();
        System.out.println(o);
    }
}
